import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index'
import Mine from "../views/Mine";
import Login from "../views/Login";
import Pwdlogin from "../views/Pwdlogin";
import Enroll from "../views/Enroll";
import Forgetpwd from "../views/Forgetpwd";
import Info from "../views/Info";
import Published from "../views/Published";
import Newpage from "../views/Newpage";

Vue.use(VueRouter)

const routes = [
  {
    path: '/mine',
    component: Mine
  },
  {
    path: '/',
    redirect:'/newpage'
  },
  {
    path: '/index',
    component: Index,
    meta: {
      keepAlive: true
    }
  },
  {
    path: '/search',
    component: ()=>import('../views/Search')
  },
  {
    path: '/detail',
    component: ()=>import('../views/Detail')
  },
  {
    path: '/music',
    component: ()=>import('../views/Music')
  },
  {
    path: '/joke',
    component: ()=>import('../views/Joke')
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/pwdlogin',
    component: Pwdlogin
  },
  {
    path: '/enroll',
    component: Enroll
  },
  {
    path: '/forgetpwd',
    component: Forgetpwd,
  },
  {
    path: '/info',
    component: Info,
  },
  {
    path: '/published',
    component: Published,
  },
  {
    path: '/newpage',
    component: Newpage,
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
